load("@io_bazel_rules_go//go:def.bzl", "go_test")

go_test(
    name = "upgradeinterlockccl_test",
    size = "enormous",
    srcs = [
        "generated_test.go",
        "local_test_util_test.go",
        "main_test.go",
    ],
    exec_properties = {"test.Pool": "large"},
    shard_count = 14,
    deps = [
        "//pkg/base",
        "//pkg/ccl",
        "//pkg/ccl/kvccl/kvtenantccl/upgradeinterlockccl/sharedtestutil",
        "//pkg/clusterversion",
        "//pkg/jobs",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/settings/cluster",
        "//pkg/spanconfig",
        "//pkg/sql",
        "//pkg/sql/catalog/lease",
        "//pkg/sql/sessiondatapb",
        "//pkg/sql/sqlinstance/instancestorage",
        "//pkg/sql/sqlliveness/slbase",
        "//pkg/sql/stats",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",  # keep
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/upgrade/upgradebase",
        "//pkg/util/leaktest",  # keep
        "//pkg/util/log",
        "//pkg/util/randutil",
        "//pkg/util/stop",
        "@com_github_stretchr_testify//require",
    ],
)

genrule(
    name = "gen-interlock-tests",
    outs = ["generated_test.go"],
    cmd = """
        $(location //pkg/ccl/kvccl/kvtenantccl/upgradeinterlockccl/testgen) -output-file-path=$(location generated_test.go)
       """,
    tools = [
        "//pkg/ccl/kvccl/kvtenantccl/upgradeinterlockccl/testgen",
    ],
    visibility = [
        ":__pkg__",
        "//pkg/gen:__pkg__",
    ],
)
